Coding with Python by Max Wainewright

Coding with Python by Max Wainewright

Author:Max Wainewright
Language: eng
Format: epub
Publisher: In Easy Steps


Make a new file

Start up IDLE or click File > New File.

Show the line numbers

Click Options >

Show Line Numbers.

Start coding!

Start typing this code into the Python editor:

Import the turtle graphics commands.

Import the random library.

Stop the turtle drawing lines between each dot.

Set the speed of the turtle to fast.

Use colour values between 0 and 255.

Repeat the code below 255 times:

Give the x and y variables a random value between -200 and 200.

Move the turtle to the coordinates (x,y).

Set the colour using the variable c.

Draw a small dot on the screen.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.